﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TalentPools.Model;
using TalentPools.DAL;

namespace TalentPools.BLL
{
   public class Admin_LoginManager
   {
       #region 登录
       public bool LoginIn(string username, string pwd)
       {
           string pwd1 = new Admin_LoginService().LoginIn(username);
           if (pwd==pwd1)
           {
               return true;
           }
           else
           {
               return false;
           }
       }
       #endregion

       #region 判断是否有权限
       /// <summary>
        /// 判断是否有权限
        /// </summary>
        /// <param name="name">Session</param>
        /// <param name="s_purview">如果有这些参数值，则有权限，否则没有。</param>
        /// <returns></returns>
       public bool Exists_Purview(string name, string s_purview)
       {
           return new Admin_LoginService().Exists_Purview(name, s_purview);
       }
       #endregion

       #region 获取权限
       /// <summary>
       /// 获取权限
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public string GetPurview(string name)
       {
           return new Admin_LoginService().GetPurview(name);
       }
       #endregion

       public Admin_Login GetAdmin(int id)
       {
           return new Admin_LoginService().GetAdmin(id);
       }

       #region 获取管理员信息
       /// <summary>
       /// 获取管理员信息
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public Admin_Login GetAdmin(string name)
       {
           return new Admin_LoginService().GetAdmin(name);
       }
       #endregion

       #region 删除管理员信息
       /// <summary>
       /// 删除管理员信息
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public bool DeleteAdmin(int name)
       {
           return new Admin_LoginService().DeleteAdmin(name);
       }
       #endregion

       #region 获取管理员信息
       /// <summary>
       /// 获取管理员信息
       /// </summary>
       /// <returns></returns>
       public List<Admin_Login> GetAdmin()
       {

           return new Admin_LoginService().GetAdmin();
       }
       #endregion

       #region 查询管理员个数
       /// <summary>
       /// 获取管理员信息
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public int GetAdminCount(string name)
       {
           return new Admin_LoginService().GetAdminCount(name);
       }
       #endregion

       #region 插入管理员
       /// <summary>
       /// 获取管理员信息
       /// </summary>
       /// <param name="admin"></param>
       /// <returns></returns>
       public bool InsertAdmin(Admin_Login admin)
       {
           return new Admin_LoginService().InsertAdmin(admin);
       }
       #endregion

       #region 修改管理员
       /// <summary>
       ///  修改邮箱、密码
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public bool UpdateAdmin(Admin_Login admin)
       {
           return new Admin_LoginService().UpdateAdmin(admin);
       }
       #endregion

       #region 修改管理员
       /// <summary>
       ///  修改邮箱、密码、权限
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public bool UpdateAdmin1(Admin_Login admin)
       {
           return new Admin_LoginService().UpdateAdmin1(admin);
       }
       #endregion

       #region 修改管理员
       /// <summary>
       ///  修改邮箱
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public bool UpdateAdmin2(Admin_Login admin)
       {
           return new Admin_LoginService().UpdateAdmin2(admin);

       }
       #endregion

       #region 修改管理员
       /// <summary>
       ///  修改邮箱、权限
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public bool UpdateAdmin3(Admin_Login admin)
       {
           return new Admin_LoginService().UpdateAdmin3(admin);

       }
       #endregion

       #region 获取密码
       /// <summary>
       ///  修改管理员
       /// </summary>
       /// <param name="name"></param>
       /// <returns></returns>
       public string GetPwd(string name)
       {
           return new Admin_LoginService().GetPwd(name);

       }
       #endregion
   }
}
